package sk.vrto.web.views;

import com.vaadin.ui.VerticalLayout;
import sk.vrto.domain.Contact;
import sk.vrto.web.presenters.ContactPresenter;
import sk.vrto.web.presenters.ContactsListPresenter;

public class ContactsListView extends VerticalLayout {

    // nester presenter for child views
    transient private final ContactPresenter contactPresenter;

    public ContactsListView(ContactsListPresenter presenter, ContactPresenter contactPresenter) {
        this.contactPresenter = contactPresenter;
        presenter.setView(this);
    }

    public void addContactItem(Contact contact) {
        addComponent(new ContactView(contact, contactPresenter));
    }

}
